package cn.tedu.wallet.service.rabbitMQ;


import cn.tedu.wallet.config.RabbitConfiguration;
import cn.tedu.wallet.pojo.po.RecordMQPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//静态导入


@Slf4j
@Component
public class RabbitMQRecordProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendRecord(RecordMQPO recordMQPO) {
        rabbitTemplate.convertAndSend(RabbitConfiguration.EXCHANGE_NAME,
                RabbitConfiguration.ROUTING_KEY,recordMQPO);
    }
}
